package com.canoe.common;

/**
 * 统一常量
 *
 * @author: btm
 * @time: 20:55 2020/9/24
 **/
public final class Constant {

    private Constant() {}

    /**当前所处路径**/
    public static final String CURRENT_PATH = System.getProperty("user.dir");
    /**unix系统的文件路径分割符**/
    private static final String UNIX_SYSTEM_PATH_SEPARATOR = "/";
    /**windows系统的文件路径分隔符**/
    private static final String WINDOWS_SYSTEM_PATH_SEPARATOR = "\\";

    /**
     * 获得当前系统的文件路径分隔符
     * @return
     */
    public static String getSystemPathSeparator() {
        if (CURRENT_PATH.startsWith(UNIX_SYSTEM_PATH_SEPARATOR)) {
            return UNIX_SYSTEM_PATH_SEPARATOR;
        } else {
            return WINDOWS_SYSTEM_PATH_SEPARATOR;
        }
    }
}
